﻿using sydfdl.TMS.BLL;
using sydfdl.TMS.Tool;
using System;
using System.Data;
using System.Web.Mvc;
using sydfdl.TMS.UtilityHelp;

namespace sydfdl.TMS.Controllers
{
    public class HomeController : Controller
    {

        #region 业务逻辑层

        BLLT_B_Menu bllMenu = new BLLT_B_Menu();

        #endregion

        #region 页面

        /// <summary>
        /// 登陆页面
        /// </summary>
        /// <returns></returns>
        public ActionResult Login()
        {

            return View();
        }


        /// <summary>
        /// 首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {

            return View();
        }

        #endregion

        #region

        public string UserLogin()
        {
            string col_loginname = Request["col_loginname"];
            string col_password = Request["col_password"];

            Session["user"] = col_loginname;

            string value = new ReadXmlHelp().RetrieveNodeValueByKey("OrderStatus", "SaveOrder");

            string value1 = new ReadXmlHelp().RetrieveNodeValueByKey("OrderStatus1", "SaveOrder");

            string value2 = new ReadXmlHelp().RetrieveNodeValueByKey("OrderStatus", "SaveOrder1");

            return string.Empty;
        }


        public void GetUser_MenuList()
        {
            DataTable dt = new DataTable();

            try
            {
                dt = bllMenu.GetUserMenuList(string.Empty, string.Empty);

            }
            catch (Exception ex)
            {
                dt = new DataTable();
            }

            var str = MiniUIJson.Encode(dt);

            Response.Write(str);
        }

        #endregion


    }
}
